package com.qf.commerce.controller;

import com.github.pagehelper.PageInfo;
import com.qf.commerce.common.dto.SeckillActivityDto;
import com.qf.commerce.entity.SeckillActivityProduct;
import com.qf.commerce.resp.ResponseResult;
import com.qf.commerce.service.SeckillActivityProductService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/product")
public class SeckillActivityProductController {
    @Resource
    SeckillActivityProductService seckillActivityProductService;
    @GetMapping("/list")
    public ResponseResult<PageInfo<SeckillActivityProduct>> queryProduct(@RequestParam(defaultValue = "1")Integer page, @RequestParam(defaultValue = "10")Integer size, SeckillActivityDto seckillActivityDto){
        return ResponseResult.success(seckillActivityProductService.queryCommodity(page, size, seckillActivityDto)) ;
    }
}
